package edu.rpi.semantic.exp.analyst;

import java.io.IOException;

import edu.rpi.semantic.utils.FileUtils;
import edu.rpi.semantic.utils.Log;

public class TestExcelInLinux {
	public static String BASIC_FILE = "./data/analysist1.xls";
	public static String EXP_RESULT_PREFIX = "./data/experiment";
	public static String SHEET_PREFIX = "round";
	
	public static int DEFAULT_DAY = 100;
	public static int NUM_TO_EXPORT = 5;
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {

		for (int expid=1; expid<=5; expid++) {
			
			Log.out("[expid:"+expid+"] begin");
			
			//copy file
			String file = EXP_RESULT_PREFIX+expid+".xls";
			try {
				FileUtils.copyFile(BASIC_FILE, file);
			} catch (IOException e) {
				e.printStackTrace();
				continue;
			}
			
			for (int roundid=1; roundid<=5; roundid++) {
			
				Log.out("[exp:"+expid+"][round:"+roundid+"] begin");
				
				//initial excel
				ExcelWriter.init(file, SHEET_PREFIX+roundid);
				
				Log.out("[exp:"+expid+"][round:"+roundid+"] initial end");
				
				//insert into excel
				ExcelWriter.write(1,1,(double)3);
				ExcelWriter.write(2, 2, (int)2);
				ExcelWriter.write(2, 100, (double)100);
				
				Log.out("[exp:"+expid+"][round:"+roundid+"] insert into excel end");
				
				//close excel
				ExcelWriter.finize();
				
				Log.out("[exp:"+expid+"][round:"+roundid+"] end");
			}

			Log.out("[expid:"+expid+"] end");
		
		}//end for
	}
}
